﻿namespace Webinator.Condition.Base
{
    using Enums;
    using Interfaces;

    /// <summary>
    /// Condition base class.
    /// </summary>
    internal class ConditionBase : ICondition
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConditionBase"/> class.
        /// </summary>
        public ConditionBase()
        {
            Type = ConditionType.Wait;
            TimeoutInMilliseconds = 5000;
            ThrowException = true;
        }

        /// <summary>
        /// Gets or sets the timeout in milliseconds.
        /// </summary>
        public int TimeoutInMilliseconds { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to throw an exception when the timeout has elapsed and the
        /// condition returns <c>false</c>.
        /// Default is <c>true</c>.
        /// </summary>
        public bool ThrowException { get; set; }

        /// <summary>
        /// Gets or sets the condition type.
        /// </summary>
        internal ConditionType Type { get; set; }
    }
}
